package com.yanfan.energy.domain.enums;

/**
 * @Author huan
 * @Description 工单管理-工单状态
 * @ClassName 2023年01月09日 14:27:00
 * @Version 1.0
 **/
public enum OrderTypeEnums {

    ORDER_NUMBER(1L, "订单号"), BATCH_NUMBER(2L, "批次号"), SEGMENTATION_NUMBER(3L, "分段号");


    private Long code;

    private String desc;

    OrderTypeEnums(Long code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 根据枚举type 返回String类型
     *
     * @param type
     * @return
     */
    public static String getEnumByType(Long type) {
        for (OrderTypeEnums item : OrderTypeEnums.values()) {
            if (item.getCode().equals(type)) {
                return item.getDesc();
            }
        }

        return "";
    }

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }


}
